<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" name="" id="a"><br>
    <button id="btn">所示</button><br>
    <input type="text" name="" id="b">
</body>
<script>
    var aInp = document.getElementById("a");
    var bInp = document.getElementById("b");

    function run(){
        debugger;
        var a = aInp.value * 1;

        a % 4 == 0 && a % 100 != 0 || a % 100 ==0 ? b.value = a + "年是闰年" : b.value = a + "年不是闰年"

    }

    btn.onclick = run;
</script>
</html>